package com.iiiu.payment.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 支付方式实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("payment_methods")
public class PaymentMethod implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 支付方式ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 支付方式名称
     */
    @NotBlank(message = "支付方式名称不能为空")
    @Size(max = 50, message = "支付方式名称长度不能超过50个字符")
    @TableField("method_name")
    private String methodName;

    /**
     * 是否删除：0-未删除，1-已删除
     */
    @TableField("is_delete")
    @TableLogic
    private Integer isDelete;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 描述
     */
    @Size(max = 255, message = "描述长度不能超过255个字符")
    @TableField("description")
    private String description;

    /**
     * 所属用户ID
     */
    @NotNull(message = "用户ID不能为空")
    @TableField("user_id")
    private Long userId;

    /**
     * 排序顺序
     */
    @TableField("sort_order")
    private Integer sortOrder;
}